package com.glory.hikvisionmobile.customView;

import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;

/**
 * *****************************
 *
 * @Anthor yazhou
 * @Email 1184545990@qq.com
 * @Time 2020/1/10 11:46
 * @DESC *****************************
 */
public class DividerDrawable extends ColorDrawable {

    public DividerDrawable(int color) {
        super(color);
    }

    @Override
    public int getIntrinsicWidth() {
        Rect rect = getBounds();
        return rect == null ? super.getIntrinsicWidth() : rect.right - rect.left;
    }

    @Override
    public int getIntrinsicHeight() {
        Rect rect = getBounds();
        return rect == null ? super.getIntrinsicHeight() : rect.bottom - rect.top;
    }
}
